<?php
	require_once("../../oh.framework/oh.framework.php");

	$fod = dirname(__FILE__)."/sheets/".date("d-m-Y").".txt";
?>
<html>
<head>
	<?php echo oh("css")->link("style.css"); ?>
</head>
<body>
	<div class="header">
		<span class="day"><?php echo date("d m Y"); ?> </span>
		<span class="time"><?php echo date("h:m:s"); ?></span>	
	</div>
	<div class="page">
		<?php
			if (oh("simpleform")->onsubmit("newrecord")) {
				oh("frecord")->prepend($fod,oh("simpleform.newrecord.message"));
			}
			
			oh("simpleform")->open("newrecord");
			oh("simpleform")->text("message");
			oh("simpleform")->close();
			
			$frecords = oh("frecord")->get($fod);
			$rowclass = "row0";			
			oh("simpleform")->open("sheet");
			echo '<table border="0" cellspacing="0" cellpadding="2" width="100%">';
			foreach($frecords as $line=>$record) {
				echo '<tr class="item '.$rowclass.'">';
				echo '<td class="buttons">';
				echo '<a class="button-red" href="">x</a> ';
				echo '<a class="button-blue" href="">da fare</a> ';
				echo '</td>';
				echo '<td>'.$record.'</td>';
				echo '</tr>';
				if ($rowclass=="row0") {$rowclass="row1";}else{$rowclass="row0";}
			}
			echo '</table>';
			oh("simpleform")->close();
		?>
	</div>
</body>
</html>
